//
//  HelpViewController.m
//  myhuibao
//
//  Created by li jun on 13-3-25.
//  Copyright (c) 2013年 myhuibao. All rights reserved.
//

#import "HelpViewController.h"

@interface HelpViewController ()

@end

@implementation HelpViewController
@synthesize  formType;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    formType = 2;
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
//    int height = formType==1?470:460;
//    int y = formType == 1?20:0;
    int height = IS_IPHONE_5?548:460;
    PagePhotosView *pagePhotosView = [[PagePhotosView alloc] initWithFrame: CGRectMake(0, 0, 320, height) withDataSource: self];
    pagePhotosView.formType = formType;
    pagePhotosView.nav=self.navigationController;
	[self.view addSubview:pagePhotosView];
    UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self
                                                                                action:@selector(handleTap:)];
    [self.view addGestureRecognizer:singleTap];
    // Do any additional setup after loading the view from its nib.
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
- (void)handleTap:(UITapGestureRecognizer *)tap {
    
    [self.navigationController popViewControllerAnimated:YES];
     
}
// 有多少页
//
- (int)numberOfPages {
	return 5;
}

// 每页的图片
//
- (UIImage *)imageAtIndex:(int)index {
	NSString *imageName = [NSString stringWithFormat:@"help_image%d.png", index + 1];
	return [UIImage imageNamed:imageName];
}
@end
